Extend the C++ keyword test to include internal GDK headers (#449016).
authorMathias Hasselmann <mathias.hasselmann@gmx.de>
Tue, 26 Jun 2007 14:24:27 +0000 (14:24 +0000)
committerMathias Hasselmann <hasselmm@src.gnome.org>
Tue, 26 Jun 2007 14:24:27 +0000 (14:24 +0000)
2007-06-22  Mathias Hasselmann  <mathias.hasselmann@gmx.de>

* configure.in, tests/Makefile.am, tests/autotestkeywords.cc,
tests/dummy-headers/*: Extend the C++ keyword test
to include internal GDK headers (#449016).

svn path=/trunk/; revision=18244

13 files changed:
ChangeLog
configure.in
tests/Makefile.am
tests/autotestkeywords.cc
tests/dummy-headers/AppKit/AppKit.h [new file with mode: 0644]
tests/dummy-headers/ApplicationServices/ApplicationServices.h [new file with mode: 0644]
tests/dummy-headers/X11/Xlib.h [new file with mode: 0644]
tests/dummy-headers/X11/Xutil.h [new file with mode: 0644]
tests/dummy-headers/commctrl.h [new file with mode: 0644]
tests/dummy-headers/directfb.h [new file with mode: 0644]
tests/dummy-headers/ft2build.h [new file with mode: 0644]
tests/dummy-headers/linux/fb.h [new file with mode: 0644]
tests/dummy-headers/windows.h [new file with mode: 0644]

index 5503c2b82109649e03e93f9eb00442a05f917ea2..e225e2ca096828b8cb941fe9f1a016feb8237328 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-06-22  Mathias Hasselmann  <mathias.hasselmann@gmx.de>
+       * configure.in, tests/Makefile.am, tests/autotestkeywords.cc,
+       tests/dummy-headers/*: Extend the C++ keyword test
+       to include internal GDK headers (#449016).
+
 2007-06-26  Mathias Hasselmann  <mathias.hasselmann@gmx.de>
 
        * ChangeLog, configure.in, tests/Makefile.am, 
index 7d85971ee92e917117f9c6153e8bd87f3a8367f9..9bfa3feb0d6c9e3adbef13c79a0c79919151ff5c 100644 (file)
@@ -142,8 +142,15 @@ dnl
 AC_CHECK_PROGS(CXX, [$CCC c++ g++ gcc CC cxx cc++ cl], gcc)
 AC_LANG_SAVE
 AC_LANG_CPLUSPLUS
+
 AC_TRY_COMPILE(,[class a { int b; } c;], ,CXX=)
 AM_CONDITIONAL(HAVE_CXX, test "$CXX" != "")
+
+gtk_save_cxxflags="$CXXFLAGS"
+CXXFLAGS="$CXXFLAGS -x objective-c++"
+AC_TRY_COMPILE([@interface Foo @end],,OBJC=yes,OBJC=no)
+AM_CONDITIONAL(HAVE_OBJC, test "$OBJC" == "yes")
+CXXFLAGS="$gtk_save_cxxflags"
 AC_LANG_RESTORE
 
 if test "$os_win32" = "yes"; then
index 6080704e67c032568c4bfdae6bf0102d1b53f32c..5f9bbf0090e815166e61fa700e0fe4a2a0e3131b 100644 (file)
@@ -26,10 +26,6 @@ endif
 
 TESTS = floatingtest buildertest
 
-if HAVE_CXX
-TESTS += autotestkeywords
-endif
-
 noinst_PROGRAMS =                      \
        autotestfilechooser             \
        autotestkeywords                \
@@ -95,7 +91,19 @@ noinst_PROGRAMS =                    \
        testtooltips                    \
        testvolumebutton
 
+if HAVE_CXX
+noinst_PROGRAMS += autotestkeywords
+TESTS += autotestkeywords
+
 autotestkeywords_SOURCES = autotestkeywords.cc
+autotestkeywords_CPPFLAGS = -I$(srcdir)/dummy-headers
+
+if HAVE_OBJC
+autotestkeywords_CPPFLAGS += -DHAVE_OBJC=1
+autotestkeywords_CXXFLAGS = -x objective-c++
+endif
+
+endif
 
 autotestfilechooser_DEPENDENCIES = $(TEST_DEPS)
 simple_DEPENDENCIES = $(TEST_DEPS)
index c6bac9d613b8f996ff1ac49db943bebb8134586b..37984b2ef2535f84c4b35b4140492fbaccd06ffb 100644 (file)
@@ -1,2 +1,35 @@
 #include <gtk/gtk.h>
+
+#define gdk_display gdk_display_directfb
+#include <gdk/directfb/gdkdirectfb.h>
+#undef gdk_display
+#undef GDK_DISPLAY
+#undef GDK_ROOT_WINDOW
+
+#define gdk_display gdk_display_linuxfb
+#include <gdk/linux-fb/gdkfb.h>
+#undef gdk_display
+#undef GDK_DISPLAY
+#undef GDK_ROOT_WINDOW
+
+#if HAVE_OBJC
+#define gdk_display gdk_display_quartz
+#include <gdk/quartz/gdkquartz.h>
+#undef gdk_display
+#undef GDK_DISPLAY
+#undef GDK_ROOT_WINDOW
+#endif
+
+#define gdk_display gdk_display_win32
+#include <gdk/win32/gdkwin32.h>
+#undef gdk_display
+#undef GDK_DISPLAY
+#undef GDK_ROOT_WINDOW
+
+#define gdk_display gdk_display_x11
+#include <gdk/x11/gdkx.h>
+#undef gdk_display
+#undef GDK_DISPLAY
+#undef GDK_ROOT_WINDOW
+
 int main() { return 0; }
diff --git a/tests/dummy-headers/AppKit/AppKit.h b/tests/dummy-headers/AppKit/AppKit.h
new file mode 100644 (file)
index 0000000..1456923
--- /dev/null
@@ -0,0 +1,24 @@
+/* Dummy header for the Quartz backend. */
+
+typedef int NSTrackingRectTag;
+
+@interface NSAutoreleasePool {}
+@end
+
+@interface NSCursor {}
+@end
+
+@interface NSEvent {}
+@end
+
+@interface NSImage {}
+@end
+
+@interface NSView {}
+@end
+
+@interface NSWindow {}
+@end
+
+@protocol NSDraggingInfo
+@end
diff --git a/tests/dummy-headers/ApplicationServices/ApplicationServices.h b/tests/dummy-headers/ApplicationServices/ApplicationServices.h
new file mode 100644 (file)
index 0000000..fb696b4
--- /dev/null
@@ -0,0 +1,8 @@
+/* Dummy header for the Quartz backend. */
+
+typedef bool BOOL;
+
+typedef void *CGContextRef;
+typedef void *CGImageRef;
+typedef void *CGPatternRef;
+
diff --git a/tests/dummy-headers/X11/Xlib.h b/tests/dummy-headers/X11/Xlib.h
new file mode 100644 (file)
index 0000000..6e5f720
--- /dev/null
@@ -0,0 +1,17 @@
+/* Dummy header for the Xlib backend. */
+
+typedef unsigned long CARD32;
+
+typedef CARD32 XID;
+
+typedef XID Atom;
+typedef XID Colormap;
+typedef XID Cursor;
+typedef XID Window;
+typedef XID VisualID;
+
+typedef struct _Display Display;
+typedef struct _GC GC;
+typedef struct _Screen Screen;
+typedef struct _Visual Visual;
+typedef struct _XImage XImage;
diff --git a/tests/dummy-headers/X11/Xutil.h b/tests/dummy-headers/X11/Xutil.h
new file mode 100644 (file)
index 0000000..f221388
--- /dev/null
@@ -0,0 +1 @@
+/* Dummy header for the Xlib backend. */
diff --git a/tests/dummy-headers/commctrl.h b/tests/dummy-headers/commctrl.h
new file mode 100644 (file)
index 0000000..ff2d792
--- /dev/null
@@ -0,0 +1 @@
+/* Dummy header for the Win32 backend. */
diff --git a/tests/dummy-headers/directfb.h b/tests/dummy-headers/directfb.h
new file mode 100644 (file)
index 0000000..045d2d6
--- /dev/null
@@ -0,0 +1,10 @@
+/* Dummy header for the DirectFB backend. */
+
+typedef int DFBColor;
+typedef int DFBSurfaceCapabilities;
+typedef int DFBSurfacePixelFormat;
+typedef int DFBWindowCapabilities;
+typedef int DFBWindowOptions;
+
+typedef struct IDirectFBWindow IDirectFBWindow;
+typedef struct IDirectFBSurface IDirectFBSurface;
diff --git a/tests/dummy-headers/ft2build.h b/tests/dummy-headers/ft2build.h
new file mode 100644 (file)
index 0000000..76c25f8
--- /dev/null
@@ -0,0 +1 @@
+/* Dummy header for the Linux framebuffer backend. */
diff --git a/tests/dummy-headers/linux/fb.h b/tests/dummy-headers/linux/fb.h
new file mode 100644 (file)
index 0000000..76c25f8
--- /dev/null
@@ -0,0 +1 @@
+/* Dummy header for the Linux framebuffer backend. */
diff --git a/tests/dummy-headers/windows.h b/tests/dummy-headers/windows.h
new file mode 100644 (file)
index 0000000..fefe9e8
--- /dev/null
@@ -0,0 +1,6 @@
+/* Dummy header for the Win32 backend. */
+
+typedef void *HDC;
+typedef void *HGDIOBJ;
+typedef void *HICON;
+typedef void *HWND;